

#include <cegfx/cemotionstate.h>


ceMotionState::ceMotionState (ceNode* node)
	: btMotionState ()
	, node (node)
{
}


void ceMotionState::setWorldTransform (const btTransform& transform)
{
	float* m = static_cast<float*>(node->GetTransform().GetMatrix());
	node->BeginTransformation ();
	transform.getOpenGLMatrix(m);
	node->EndTransformation();
}

void ceMotionState::getWorldTransform (btTransform& transform) const
{
	float* m = static_cast<float*>(node->GetTransform().GetMatrix());
	transform.setFromOpenGLMatrix(m);
}
